package com.yq.day22._01string;


/**
 * @author 3307235355@qq.com
 * @since 2022/06/22 14:26
 */
public class Demo03 {
    public static void main(String[] args) {
        //    将第一个字母转换为大写的
        String s = "i want to bing dudnun";
        String result = "";
        String[] s1 = s.split(" ");
        // for (int i = 0; i < s1.length; i++) {
        //     // String start = s1[i].substring(0, 1);
        //     // String end = s1[i].substring(1);
        //     // String s2 = start.toUpperCase()+end+" ";
        //
        //     result +=s2;
        //
        // }
        for (String s2 : s1) {
            String concat = s2.substring(0, 1).toUpperCase().concat(s2.substring(1));
            result+=concat+" ";
        }
        System.out.println(result.trim());
        System.out.println(result);
    }
}
